package demo02;

public class Test {
    public static void func1(Animal animal){
        animal.eat();
    }
    public static void testIFly(IFly iFly){
        iFly.fly();
    }
    public static void testISwim(ISwim iSwim){
        iSwim.swim();
    }
    public static void testIRun(IRun iRun){
        iRun.run();
    }

    public static void main(String[] args) {
        testIFly(new Bird("bugu"));
        testIRun(new Dog("gou"));
//        testISwim(new Bird("bugu")); Bird没有实现游泳的接口，所以是不能运行的
        testISwim(new Dog("gou"));
        testIRun(new Roboot());
    }
    public static void main1(String[] args) {
        func1(new Dog("wangwang"));
        func1(new Bird("xiaoniao"));
    }
}
